package com.yang.reflectionstudy;

import com.yang.Student;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class demo03 {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("com.yang.Student");
        Method[] method = aClass.getMethods();
        for (Method method1 : method) {
            System.out.println(method1);
        }
        System.out.println("..........................");

        Method method1 = aClass.getMethod("method1");
        Constructor<?> constructors = aClass.getConstructor();
        Object o = constructors.newInstance();
        method1.invoke(o);
//        Student student = new Student();
//        student.method1();
    }
}
